﻿<div id="admin_table">
    <datagrid ref="roles" :columns="gridColumns" :edit="{showAdd:true,delUrl:'@ViewBag.DelUrl',saveUrl:'@ViewBag.SaveUrl',autoload:true}" :date="false" :url="'@ViewBag.DataUrl'" :params="{t:'@ViewBag.Table'}">
        <div slot="other_query" class="tb-item">
            <select name="date" class="form-control select2" id="collect_date">
                <option value="" selected>直播日期</option>
                @for (var i = 19; i < 29; i++)
                {
                <option value="@i">@i</option>
                }
            </select>
        </div>
    </datagrid>
</div>
<script>
    $(function () {
        $(document.body).loadTemplate(['datagrid'], function () {
                roleTable = new Vue({
                    el: '#admin_table',
                    data: {
                        gridData: [],
                        gridColumns: [
                                    { bind: 'Id', title: '编号', width:'100px', editor: { type: 'number' } },
                                    { bind: 'Time', title: '时间', width: '200px', editor: { type: 'text' } },
                                    { bind: 'Title', title: '标题', width: '300px', editor: { type: 'text' } },
                                    { bind: 'Url', title: '链接地址', editor: { type: 'text' } },
                                    { bind: 'Date', title: '直播日期', width:'100px', editor: { type: 'number' } },
                                    { bind: 'LastModify', width:'180px', title: '最后修改时间' }
                        ]
                    },
                    events: {
                        'query': function (qParams) {
                            qParams.date = $('#collect_date').val();
                            if (qParams.date == "") qParams.date = "0";
                        }
                    },
                });
            });
        setNav('@ViewBag.Title');
    });
</script>